package com.YHVision.qiuzhike.service;

import com.YHVision.qiuzhike.model.entity.Question;
import com.YHVision.qiuzhike.model.entity.User;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.YHVision.qiuzhike.model.dto.questionFavour.QuestionFavourQueryRequest;
import com.YHVision.qiuzhike.model.entity.QuestionFavour;

import javax.servlet.http.HttpServletRequest;

/**
 * 题目收藏服务
 *
 * @author <a href="">YHVision-小y</a>
 * @from <a href="todo">爱编程学习圈</a>
 */
public interface QuestionFavourService extends IService<QuestionFavour> {

    /**
     * 题目收藏
     * @param questionId
     * @param logingUser
     * @return
     */
    int doQuestionFavour(long questionId, User logingUser);


    /**
     * 题目收藏（内部服务）
     * @param userId
     * @param questionId
     * @return
     */
    int doQuestionFavourInner(long userId, long questionId);

    /**
     *
     * 分页获取题目收藏列表
     * @param page
     * @param queryWrapper
     * @return
     */
    Page<Question> listQuestionFavourByPage(IPage<Question> page, Wrapper<Question> queryWrapper,long favourUserId);
}


